﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="FileManager.aspx.cs" Inherits="EXAM.Admin.Page_Admin.FileManager" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlacebody" runat="server">
    <telerik:RadCodeBlock ID="codeBlock1" runat="server">

        <script type="text/javascript">
            //<![CDATA[
            function OnClientItemSelected(sender, args)
            {
                var pvwImage = $get("<%= pvwImage.ClientID %>");
                var imageSrc = args.get_path();

                if (imageSrc.match(/\.(gif|jpg)$/gi))
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "";
                    pvwImage.alt = imageSrc.substring(imageSrc.lastIndexOf('/') + 1);
                }
                else
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "none";
                    pvwImage.alt = imageSrc.substring(imageSrc.lastIndexOf('/') + 1);
                }
            }
            function FileExplorer1_Delete(sender, args)
            {
                args._cancel=GetBoolean("<%= allowDelete%>");
            }
            function GetBoolean(val)
            {
                return val=="True";
            }
            //]]>
        </script>

    </telerik:RadCodeBlock>
    <telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" DecoratedControls="All"
        Skin="Vista" />
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <table cellpadding="0" cellspacing="6" border="0" class="tableForm" id="tblManagePartner">
                    <tr>
                        <td align="center" class="formTitle">
                            Analysis Definition
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellspacing="4">
                                <tr>
                                    <td>
                                        <telerik:RadButton ID="btnUpload" Text="Upload Folder" runat="server" OnClick="btnUpload_Click"
                                            Visible="false">
                                        </telerik:RadButton>
                                        <telerik:RadButton ID="btnTemplate" Text="Report Template Folder" runat="server"
                                            OnClick="btnTemplate_Click" Visible="false">
                                        </telerik:RadButton>
                                        <telerik:RadButton ID="btnTmp" Text="Temp Folder" runat="server" OnClick="btnTmp_Click"
                                            Visible="false">
                                        </telerik:RadButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td rowspan="2" style="vertical-align: top;">
                                        Browse to an image and double click to preview.
                                        <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="520px" Height="520px"
                                            OnClientItemSelected="OnClientItemSelected" 
                                            onclientdelete="FileExplorer1_Delete">
                                            <Configuration ViewPaths="~/Upload,~/Template" UploadPaths="~/Upload" 
                                                DeletePaths="~/Upload" MaxUploadFileSize="20480000" />
                                        </telerik:RadFileExplorer>
                                    </td>
                                    <td>
                                        <fieldset style="width: 230px; height: 220px">
                                            <legend>Preview</legend>
                                            <img id="pvwImage" src="~/Imgages/qsfConfigPixel.gif" runat="server" alt="~/Imgages/qsfConfigPixel.gif"
                                                style="display: none; margin: 10px; width: 200px; height: 180px; vertical-align: middle;" />
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top" id="decoratorZone">
                                        <fieldset style="width: 230px; height: 320px;">
                                            <legend>Properties</legend>
                                            <h5>
                                                Choose explorer controls:</h5>
                                            <asp:CheckBoxList Width="140px" ID="visibleControls" CellSpacing="0" runat="server">
                                                <asp:ListItem Selected="true" Text="Address Box" Value="AddressBox"></asp:ListItem>
                                                <asp:ListItem Selected="true" Text="Grid" Value="Grid"></asp:ListItem>
                                                <asp:ListItem Selected="true" Text="Toolbar" Value="Toolbar"></asp:ListItem>
                                                <asp:ListItem Selected="true" Text="TreeView" Value="TreeView"></asp:ListItem>
                                                <asp:ListItem Selected="true" Text="Context Menus" Value="ContextMenus"></asp:ListItem>
                                            </asp:CheckBoxList>
                                            <h5>
                                                Set control behavior:</h5>
                                            <asp:CheckBox ID="enableUpload" Width="130px" Text="Enable upload?" Checked="true"
                                                runat="server" Style="margin-left: 3px" />
                                            <br />
                                            <asp:CheckBox ID="enableCreateNewFolder" Width="130px" Text="Allow new folders?"
                                                Checked="true" runat="server" Style="margin-left: 3px" />
                                            <br />
                                            <asp:CheckBox ID="displayUpFolder" Width="160px" Text="Display up folder(..) item?"
                                                Checked="false" runat="server" Style="margin-left: 3px" />
                                            <br />
                                            <asp:CheckBox ID="enableOpenFile" Width="165px" Text="Open files on double-click?"
                                                Checked="true" runat="server" Style="margin-left: 3px" />
                                            <br />
                                            <asp:CheckBox ID="allowPaging" Width="165px" Text="Enable paging for the grid" Checked="false"
                                                runat="server" Style="margin-left: 3px" />
                                            <br />
                                            <br />
                                            <asp:Button ID="Update" Text="Update RadFileExplorer" Width="145px" runat="server" />
                                        </fieldset>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
